//
//  NSDate+DateFormat.h
//  ELearningClient
//
//  Created by Jim Fu on 2018/12/19.
//

#import <Foundation/Foundation.h>

@interface NSDate (DateFormat)

/**
 *  Convert NSDate to formatted string
 *
 *  @return formatted string without time
 */

- (NSString *)convertToFormattedStringWithoutTime;

/**
 *  Convert NSDate to formatted string
 *
 *  @return formatted string
 */
- (NSString *)convertToFormattedString;

/**
 *  Convert NSDate to yyyy-MM-dd-HH-mm-ss
 *
 *  @return formatted string
 */
- (NSString *)convertToStandardFormatString;

/**
 *  Convert NSDate to yyyy-MM-dd HH:mm:ss
 *
 *  @return formatted string
 */
- (NSString *)convertToStandardFormatStringWithYMDHMS;

/**
 *  Convert NSDate to yyyy-MM-dd
 *
 *  @return formatted string
 */
- (NSString *)convertToDateFormatString;


/**
 *  Convert NSDate to yyyy.MM.dd
 *
 *  @return formatted string
 */
- (NSString *)convertToDateFormatPointString;

/**
 *  Convert NSDate to yyyy年MM月dd日
 *
 *  @return formatted string
 */
- (NSString *)convertToYearMonthDayDateFormatString;

/**
 *  Convert NSDate to yyyy年MM月dd日 HH:mm:ss
 *
 *  @return formatted string
 */
- (NSString *)convertToLongDateFormatString;

/**
 *  Convert NSDate to MM-dd日 HH:mm:ss
 *
 *  @return formatted string
 */
- (NSString *)convertToMonthDayDateFormatString;


/**
 *  Convert NSDate to yyyy-MM-dd HH:mm
 *
 *  @return formatted string
 */
- (NSString *)coverToDataWithyyyymmddhhmm;

/**
 *  Convert NSDate to yyyy/MM/dd
 *
 *  @return formatted string
 */
- (NSString *)coverToDateWithyyyymmdd;

/**
 *  获取当天零点日期
 *
 *  @return NSDate
 */
+ (instancetype)zeroToday;

/**
 *  获取Date的零点日期
 *
 *  @param date 日期
 *
 *  @return NSDate
 */
+ (instancetype)zeroWithDate:(NSDate *)date;


/**
 *  Convert NSDate to 今天/昨天/周几
 *
 *  @return formatted string
 */
- (NSString *)convertToWeekdayString;

/**
 *  Convert second to x'xx''
 *
 *  @param time second
 *
 *  @return formatted string
 */
+ (NSString *)convertSecondToString:(NSTimeInterval)time;


/**
 距离当前多少天

 @return day
 */
- (NSString *)convertDaysSineNow;

/**
 Convert NSDate 超过24小时，显示YMD

 @return formatted string
 */
- (NSString *)converToDayDate;

/**
 Convert NSDate to locale Date with Zero hour minute and second.
 
 @return locale Date
 */
+ (NSDate *)convertLocaleDateWithZeroTime:(NSDate *)utcDate;

+ (double)getCPUTime;

+ (time_t)uptime;

@end
